/*
 * Copyright (c) 2011 Sicong
 *
 * All rights reserved.
 */
package com.sicong.myproject.client;

import com.google.gwt.user.client.ui.RootPanel;

/**
 * 
 * Central controller, swap content, get user, notify user listeners
 * 
 * @author sicongzhao
 *
 */
public class Controller
{
    private static Controller instance_;
    
    private Controller()
    {
        
    }
    
    public static Controller getInstance()
    {
        if (instance_ == null)
        {
            instance_ = new Controller();
        }
        
        return instance_;
    }
    
    public void setContent(Content content)
    {
        RootPanel.get("content").clear();
        RootPanel.get("content").add(content);
    }
    
    public void addContent(Content content)
    {
        RootPanel.get("content").add(content);
    }
}
